package com.example.zsfinacialmanage.view;

import android.Manifest;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.example.zsfinacialmanage.R;
import com.example.zsfinacialmanage.activity.*;
import com.example.zsfinacialmanage.constant.MessageConstant;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.tbruyelle.rxpermissions2.RxPermissions;

public class MainActivity extends AppCompatActivity {
    Button bt_newincome,bt_incomedetail,btn_newpay,btn_paydetail,bt_dataanalyse,btn_setting,btn_top;
    TextView txt_version;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnOnclick();
    }

    private void initView(){
        bt_newincome=findViewById(R.id.bt_newincome_main);
        bt_incomedetail=findViewById(R.id.bt_incomedetail_main);
        btn_newpay=findViewById(R.id.bt_newpay_main);
        btn_paydetail=findViewById(R.id.bt_paydetail_main);
        bt_dataanalyse=findViewById(R.id.bt_dataanalyse_mian);
        btn_setting=findViewById(R.id.bt_syssetting_main);
        txt_version=findViewById(R.id.txt_version_main);
        btn_top=findViewById(R.id.bt_top_main);

        txt_version.setText(MessageConstant.VERSION_NUMBER);
    }
    private void btnOnclick(){
        bt_newincome.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this, NewInComeActivity.class);
                startActivity(intent);
            }
        });
        bt_incomedetail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this, InComeDetailActivity.class);
                startActivity(intent);
            }
        });
        btn_newpay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this, NewPayActivity.class);
                startActivity(intent);
            }
        });
        btn_paydetail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this, PayDetailActivity.class);
                startActivity(intent);
            }
        });
        bt_dataanalyse.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this, DataAnalyseActivity.class);
                startActivity(intent);
            }
        });
        btn_setting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,SysSettingActivity.class);
                startActivity(intent);
            }
        });
        btn_top.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // 创建一个意图（Intent）
                Intent intent = new Intent(Intent.ACTION_VIEW);

                // 设置意图的URI为要跳转的网址
                intent.setData(Uri.parse("https://xinxipilu.chinawealth.com.cn/"));

                // 启动意图，跳转到指定的网址
                startActivity(intent);
            }
        });
    }
}